<template>
    <div class="wallpaper_space_container" ref="wallpaper_space_container">
        <el-space v-for="item in data_" :key="item" class="wallpaper_sapace" direction="vertical"
            alignment="flex-start">
            <el-skeleton :loading="loading_" animated>
                <template #template>
                    <el-skeleton-item class="wallpaper_item" />
                </template>
                <template #default>
                    <div class="wallpaper_image">
                        <div>
                            <img class="wallpaper_item"
                                src="https://bizhi1.com/wp-content/uploads/2024/02/beautiful-fantasy-landscape-desktop-wallpaper-small.jpg"
                                alt="">
                        </div>
                        <div class="wallpaper_info"></div>
                    </div>
                </template>
            </el-skeleton>
        </el-space>

    </div>
    <div style="display: flex;align-items: end;justify-content: flex-end;">
        <el-pagination background layout="prev, pager, next" :total="data" />
    </div>
</template>

<script>
export default {
    props: ['loading', 'column', 'data'],
    data() {
        return {
            loading_: false,
            data_: null,
        }
    }, mounted() {
        this.data_ = this.data
        this.loading_ = this.loading
        if (this.column)
            this.$refs.wallpaper_space_container.style.gridTemplateColumns = `repeat(${this.column}, 0.1fr)`
    }
}
</script>

<style scoped>
.wallpaper_space_container {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    width: 1430px;

    .wallpaper_sapace {

        .wallpaper_item {
            border-radius: var(--raduis);
            margin: 10px;
            width: 270px;
            height: 175px;
            transition: all 0.3s;
        }

        .wallpaper_item:hover {
            /* transform: scale(1.1); */
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);

        }

    }

    .wallpaper_image {
        position: relative;

        .wallpaper_info {
            transition: all 0.3s;
            border-radius: var(--raduis);
            position: absolute;
            top: 10px;
            left: 10px;
            width: 270px;
            height: 175px;
            background-color: rgba(0, 0, 0, 0.178);
            color: #fff;
            text-align: center;
            line-height: 30px;
            font-size: 14px;
        }

        .wallpaper_info:hover {
            background-color: rgba(255, 255, 255, 0);
        }
    }

}
</style>